namespace ClassyBlog.Web.Specs.Unit
{
    using Machine.Specifications;

    using DomainObjects;

    [Subject(typeof(ApplicationController))]
    public class when_blog_is_set_in_application_controller
    {
        static Blog blog;
        static ApplicationController controller;

        Establish contenxt = () =>
        {
            blog = ObjectMother.CreateBlog();
            controller = new ApplicationControllerTestDouble();
        };

        Because of = () => controller.SetBlog(blog);

        It should_return_the_same_blog = () =>
            controller.Blog.ShouldBeTheSameAs(blog);

        private class ApplicationControllerTestDouble : ApplicationController
        {
        }
    }
}